Repository navigation
DMA: 2 cosmetic patches - #1508
Merged
Merged
Conversation
tlauda
approved these changes
Jun 3, 2019
Contributor
|
@lyakh IMX build failure. |
Contributor
|
@lyakh please update changed ops for imx also |
Contributor
|
@lyakh Ping. |
lgirdwood
approved these changes
Jun 5, 2019
Fix indentation in hda_link_dma_ops and hda_host_dma_ops. Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
The DMA "channel" parameter, used in many DMA API functions, is currently only checked for "< HDA_DMA_MAX_CHANS" except for one case, where it's also checked for ">= 0." But if a configuration step is missed, the channel can stay at its initial value of DMA_CHAN_INVALID which is equal to (32-bit) -1, or it can contain a negative error code, returned by dma_channel_get(). Therefore a comparison to HDA_DMA_MAX_CHANS doesn't catch such cases. This leads to a panic like in issue thesofproject#1485 To avoid such crashes make "channel" unsigned everywhere and make checks more consistent. Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The first one is really just a cosmetic improvement. The second one actually "fixes" a panic, documented in #1485 but it certainly doesn't improve the situation. Instead of a panic the IPC request fails "gracefully," but that still doesn't fix the problem, maybe a panic is a better or at least also a valid reaction to the problem.